<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>日志列表</title>
    <link href="<%=path%>/css/core.css" rel="stylesheet" type="text/css"/>
    <link href="<%=path%>/css/form.css" rel="stylesheet" type="text/css"/>
    <link href="<%=path%>/css/list.css" rel="stylesheet" type="text/css"/>
    <link href="<%=path%>/css/blog.css" rel="stylesheet" type="text/css"/>
    <link href="<%=path%>/css/xToolbar.css" rel="stylesheet" type="text/css"/>
    <link href="<%=path%>/css/jquery-impromptu.css" rel="stylesheet" type="text/css"/>
    <link href="<%=path%>/css/UsersSelect.css" rel="stylesheet" type="text/css"/>
    <link href="<%=path%>/css/xWindowPanel.css" rel="stylesheet" type="text/css"/>
  </head>
  <body>
    <div id="toolbar"></div>
    <div id="blog" class="blog">
      <s:bean id="forDate" name="java.util.Date"/>
      <s:iterator id="blogAgg" value="blogAggList" status="i">
        <s:if test="#forDate.getTime() != #blogAgg.forDate.getTime()">
          <s:if test="#i.index > 0">
              </ul>
            </div>
          </s:if>
          <s:set name="forDate" value="#blogAgg.forDate"/>
          <div class="blog-line">
            <div class="blog-date">
              <div class="blog-date-year"><s:date name="#blogAgg.forDate" format="yyyy-MM"/></div>
              <div class="blog-date-d"><s:date name="#blogAgg.forDate" format="dd"/></div>
            </div>
            <ul class="blog-content">
        </s:if>
        <li class="head-view" style="background-image:url('<%=path%><s:if test="#blogAgg.creator.normalImage == null">/image/UsersSelect/grid_sex_<s:property value="#blogAgg.creator.sex"/>.png</s:if><s:else><s:property value="#blogAgg.creator.normalImage"/></s:else>');">
          <div class="agg-count head-hover"><s:property value="#blogAgg.count"/></div>
          <div class="realname" title="<s:property value="#blogAgg.creator.realName"/>"><s:property value="#blogAgg.creator.realName"/></div>
        </li>
      </s:iterator>
        </ul>
      </div>
    </div>
    <form id="listForm" class="search-div" action="<%=path%>/daily/blog/search.t4m" method="post">
      <s:hidden name="searchType"/>
      <input type="hidden" id="result" name="result" value="<s:property value="result"/>"/>
      <input type="hidden" name="forDate" value="<s:date name="forDate" format="yyyy-MM-dd"/>"/>
      <div class="search-condition">
        <table class="search-table" cellspacing="0" cellpadding="0">
          <tr>
            <td class="c-left">内容：</td>
            <td><input name="searchValue" type="text" class="text" value="<s:property value="searchValue[0]"/>"/></td>
            <td class="c-left">标签：</td>
            <td><input name="searchValue" type="text" class="text" value="<s:property value="searchValue[1]"/>"/></td>
          </tr>
          <tr>
            <td class="c-left">发表时间：</td>
            <td><input name="searchValue" id="minD" type="text" class="text Wdate" value="<s:property value="searchValue[2]"/>" onclick="WdatePicker({maxDate:'#F{$dp.$D(\'maxD\')}'});"/></td>
            <td class="c-left">到：</td>
            <td><input name="searchValue" id="maxD" type="text" class="text Wdate" value="<s:property value="searchValue[3]"/>" onclick="WdatePicker({minDate:'#F{$dp.$D(\'minD\')}'});"/></td>
          </tr>
          <tr>
            <td class="c-left">创建人：</td>
            <td colspan="3"><input id="creator" name="searchValue" type="hidden" value="<s:property value="searchValue[4]"/>"/></td>
          </tr>
        </table>
      </div>
      <div class="search-commit">
        <a href="javascript:void(0)" class="search-button" onclick="$('#searchType').val('and');$('#listForm').submit();">与查询</a>
        <a href="javascript:void(0)" class="search-button" onclick="$('#searchType').val('or');$('#listForm').submit();">或查询</a>
      </div>
    </form>
    <script src="<%=path%>/js/tinyMCE/tiny_mce.js" type="text/javascript"></script>
    <script src="<%=path%>/js/jquery.js" type="text/javascript"></script>
    <script src="<%=path%>/js/core.js" type="text/javascript"></script>
    <script src="<%=path%>/js/Upload.js" type="text/javascript"></script>
    <script src="<%=path%>/js/share.js" type="text/javascript"></script>
    <script src="<%=path%>/js/UsersSelect.js" type="text/javascript"></script>
    <script src="<%=path%>/js/xWindowPanel.js" type="text/javascript"></script>
    <script src="<%=path%>/js/Draggable.js" type="text/javascript"></script>
    <script src="<%=path%>/js/xToolbar.js" type="text/javascript"></script>
    <script src="<%=path%>/js/xToolbar.items.js" type="text/javascript"></script>
    <script src="<%=path%>/js/Validate.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(document).ready(function(){
      
      new Toolbar({
        id: '1',
        renderTo : 'toolbar',
        icon: '../../image/op.gif',
        items : [{
          type:'button',
          text:'新建',
          useable : '<s:property value="@org.team4.util.Meta@getOperate(\"blog_new\")"/>',
          position: {
            a: '0px 0px',
            b: '0px -120px'
          },
          handler:function(){
            top.blog.add();
          }
        },'-',{
          type: 'search'
        },'-',{
          type:'button',
          text:'刷新',
          position: {
            a: '-60px 0px',
            b: '-60px -120px'
          },
          handler:function(){
            $('#listForm').submit();
          }
        },{
          type: 'filters',
          active: '<s:property value="result"/>',
          items: [{
            id : 'aggregation',
            tip : '聚合浏览',
            position: {
              a: '-100px -240px'
            },
            handler : function(){
              changeViewType('aggregation');
            }
          },{
            id : 'success',
            tip : '微博浏览',
            position: {
              a: '-80px -240px'
            },
            handler : function(){
              changeViewType('success');
            }
          }]
        }]
      });
      
      $('.head-view').hover(function(){
        $(this).addClass('head-hover');
      },function(){
        $(this).removeClass('head-hover');
      });
      
      $('#blog').height($(document.body).height() - $('#toolbar').outerHeight() - 8);
      $('.blog-content').width($(document.body).width() - 95);
      loadReady();
    });
    
    function changeViewType(result) {
      $('#result').val(result);
      $('#listForm').submit();
    }
    </script>
  </body>
</html>